/*************************************************************************
	> File Name: callback.c
	> Author: Angel Criss
	> Mail: abbytsing@gmail.com 
	> Created Time: 五 10/17 15:11:11 2014
 ************************************************************************/

#include<stdio.h>
#include<stdlib.h>

void do_call(int start)
{
    int res;
    while(start--)
    {
        res+=start;
        if(res % 2 == 0)
            printf("res = %d\n",res);
    }
}

void call_back(void (*do_call)(int),int n)
{
    do_call(n);
}

int main(int argc,char *argv[])
{
    call_back(do_call,atoi(argv[1]));
    return 0;
}
